package at.jku.se.fastsell.db4o.transactions;

import at.jku.se.fastsell.data.Auction;
import at.jku.se.fastsell.db4o.DatabaseException;

public class StoreAuctionTransaction extends Transaction<Void> {
	
	private Auction a;
	
	// --------------------------------------------------------------------------------------------
	
	public StoreAuctionTransaction(Auction a) {
		this.a = a;
	}
	
	// --------------------------------------------------------------------------------------------

	@Override
	public Void run() throws DatabaseException {
		db.ext().store(a, 3);
		commit();
		
		return null;
	}
	
	// --------------------------------------------------------------------------------------------
	
	@Override
	public String toString() {
		return super.toString() + ": " + a;
	}

}
